package main

import "fmt"

/*
  接口嵌套
*/

type Animal interface {
	getName()
}

type Mail interface {
	SendMail()
}

type Active interface {
	Animal
	Mail
}

type People struct {
	Name string
}

func (p People) getName() {
	fmt.Println(p.Name, "getName")
}

func (p People) SendMail() {
	fmt.Println(p.Name, "SendMail")
}

func main() {
	p := People{
		Name: "张三",
	}
	var active Active = p
	active.getName()
	active.SendMail()
}
